package com.nstar.model.orderexpress;

import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


/** 
 *        @hibernate.class
 *         table="menu_2_rest"
 *     
*/
public class Menu2Rest implements Serializable {

    /** nullable persistent field */
    private Integer discount;

    /** nullable persistent field */
    private Integer vote;

    /** nullable persistent field */
    private byte[] image;

    /** nullable persistent field */
    private Date createDate;

    /** identifier field */
    private com.nstar.model.orderexpress.RestInfo restInfo;

    /** identifier field */
    private com.nstar.model.orderexpress.OrderMenu orderMenu;

    /** full constructor */
    public Menu2Rest(Integer discount, Integer vote, byte[] image, Date createDate, com.nstar.model.orderexpress.RestInfo restInfo, com.nstar.model.orderexpress.OrderMenu orderMenu) {
        this.discount = discount;
        this.vote = vote;
        this.image = image;
        this.createDate = createDate;
        this.restInfo = restInfo;
        this.orderMenu = orderMenu;
    }

    /** default constructor */
    public Menu2Rest() {
    }

    /** minimal constructor */
    public Menu2Rest(com.nstar.model.orderexpress.RestInfo restInfo, com.nstar.model.orderexpress.OrderMenu orderMenu) {
        this.restInfo = restInfo;
        this.orderMenu = orderMenu;
    }

    /** 
     *            @hibernate.property
     *             column="DISCOUNT"
     *             length="11"
     *         
     */
    public Integer getDiscount() {
        return this.discount;
    }

    public void setDiscount(Integer discount) {
        this.discount = discount;
    }

    /** 
     *            @hibernate.property
     *             column="VOTE"
     *             length="11"
     *         
     */
    public Integer getVote() {
        return this.vote;
    }

    public void setVote(Integer vote) {
        this.vote = vote;
    }

    /** 
     *            @hibernate.property
     *             column="IMAGE"
     *             length="2147483647"
     *         
     */
    public byte[] getImage() {
        return this.image;
    }

    public void setImage(byte[] image) {
        this.image = image;
    }

    /** 
     *            @hibernate.property
     *             column="CREATE_DATE"
     *             length="19"
     *         
     */
    public Date getCreateDate() {
        return this.createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /** 
     *                @hibernate.many-to-one
     *             
     *                @hibernate.column
     *                 name="REST_ID"
     *             
     */
    public com.nstar.model.orderexpress.RestInfo getRestInfo() {
        return this.restInfo;
    }

    public void setRestInfo(com.nstar.model.orderexpress.RestInfo restInfo) {
        this.restInfo = restInfo;
    }

    /** 
     *                @hibernate.many-to-one
     *             
     *                @hibernate.column
     *                 name="MENU_ID"
     *             
     */
    public com.nstar.model.orderexpress.OrderMenu getOrderMenu() {
        return this.orderMenu;
    }

    public void setOrderMenu(com.nstar.model.orderexpress.OrderMenu orderMenu) {
        this.orderMenu = orderMenu;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("restInfo", getRestInfo())
            .append("orderMenu", getOrderMenu())
            .toString();
    }

    public boolean equals(Object other) {
        if ( (this == other ) ) return true;
        if ( !(other instanceof Menu2Rest) ) return false;
        Menu2Rest castOther = (Menu2Rest) other;
        return new EqualsBuilder()
            .append(this.getRestInfo(), castOther.getRestInfo())
            .append(this.getOrderMenu(), castOther.getOrderMenu())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getRestInfo())
            .append(getOrderMenu())
            .toHashCode();
    }

}
